package com.skcc.cip.ngms.mail.processor;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;

public class MailPushC2DM implements Processor{

	public void process(Exchange exchange) throws Exception {
		
		SubscribeData data = exchange.getIn().getBody(SubscribeData.class);
		
		exchange.getIn().setHeader("Content-Type", "application/x-www-form-urlencoded");
		exchange.getIn().setHeader("Authorization", "GoogleLogin auth="+data.getAuthToken());
		
		String pushMsg = "registration_id="+data.getRegistrationId()+"&collapse_key=2&delay_while_idle=1&data.msg="+exchange.getProperty("pushMsg");
		exchange.getIn().setBody(pushMsg);
	}
}